package net.tngou.iask.quartz;

import java.util.List;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import net.tngou.iask.jdbc.DBManager;
import net.tngou.iask.pojo.Cure;
import net.tngou.iask.service.CureService;

/**
 * 问卷执行
 * @author tngou@tngou.net
 *
 */
public class AccessJob implements Job {

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		
		CureService service = new CureService();
		List<Cure> list = service.getFollowCure(0);//当天执行
		
		list.forEach(e->{
			service.saveAccess(e, e.getSurvey());
		});
		DBManager.closeConnection(); //释放数据库连接到连接池中
	}

}
